<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="icon" href="images/icon/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" type="text/css" href="BootStrap/css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="layui-v2.5.7/layui/css/layui.css"/>
    <script src="layui-v2.5.7/layui/layui.js"></script>
    <script src="javascript/jquery.js"></script>
    <script src="BootStrap/js/bootstrap.min.js"></script>
    <style>
        .layui-table tbody tr:hover {
            background-color: white;
        }
    </style>
</head>
<body>
<!--
    用户详情页
-->
 <div class="page-wrap">
    <div class="breadcrumb">
        <ul>

            <li><a href="WeiXiuRenYuan.html" >维修人员</a><i class="icon-angle-right"></i></li>
            <li><a >维修人员详情</a><i class="icon-angle-right"></i></li>
        </ul>
    </div>
</div>
<form id="edit_form">
    <input type="hidden" name="userid" />
    <table class="layui-table" lay-skin="nob" style="text-align: left;">
        <tr style="text-align: left;">
            <td colspan="3">
                    <i class="glyphicon glyphicon-option-vertical" style="font-size: 138%;color: #3b97d7"></i>
                    <font color="#d3d3d3" size="5">基本信息</font>
            </td>
        </tr>

        <tr>
            <td>手机号:
                &nbsp;&nbsp;&nbsp;
                <span id="phone"></span></td>
            <td>人员名称:
                &nbsp;&nbsp;&nbsp;
                <span id="name"></span></td>
            <td>性别:
                &nbsp;&nbsp;&nbsp;
                <span id="sex"></span></td>
        </tr>
        <tr>
            <td>密码:
                &nbsp;&nbsp;&nbsp;
                <span id="passwords"></span></td>
            <td>注册时间:
                &nbsp;&nbsp;&nbsp;
                <span id="time"></span></td>
            <td>用户邮箱:
                &nbsp;&nbsp;&nbsp;
                <span id="email"></span></td>
        </tr>
    </table>
</form>
<table class="layui-table" lay-skin="line">
    <tr style="text-align: left;">
        <td>
            <i class="glyphicon glyphicon-option-vertical" style="font-size: 138%;color: #3b97d7"></i>
            <font color="#d3d3d3" size="5">维修记录</font>
        </td>
    </tr>
    <tr>
        <td colspan="2" style="border: 2px solid lightskyblue;background-color: #DDF1FF;">
            维修记录总数:&nbsp;&nbsp;&nbsp;
            <span id="table_count"></span>
        </td>
    </tr>
    <tr>

    </tr>
    <table class="layui-table" lay-skin="nob">
        <td colspan="2">
            <thead>
                <tr>
                    <th>医院名称</th>
                    <th>所属科室</th>
                    <th>床位编号</th>
                    <th>故障原因</th>
                    <th>维修状态</th>
                    <th>维修时间</th>
                </tr>
            </thead>
            <tbody id="table_order">

            </tbody>
        </td>
    </table>
</table>
<script>
    layui.use("form",function () {
        var form = layui.form;
    });
    var userid = window.localStorage.getItem("userid");

    /**
     * 展示人员信息详情
     */
    getUserXinXi();
    function getUserXinXi(){
        $.ajax({
            url:'/yonghu/getOneUserWeiXiu',
            data:{"userId":userid},
            type:'post',
            success:function (data){
                if(data.result) {
                    $("#phone").text(data.user.userphone);
                    $("#name").text(data.user.username);
                    $("#sex").text(data.user.usersex == 1 ? '男' : '女');
                    $("#passwords").text(data.user.userpassword);
                    $("#time").text(data.user.userregistrationtime);
                    $("#email").text(data.user.useremail);
                }
                var str="";

                if(data.result){
                    for (var i = 0; i < data.yiyuanname.length; i++) {
                        str+="<tr>";
                        str+="<td>"+data.yiyuanname[i].hospitalinfoname+"</td>>";
                        str+="<td>"+data.keshiname[i].departmentname+"</td>>";
                        if(data.chuangwei[i]!=null){
                            str+="<td>"+data.chuangwei[i].bedmessageid+"</td>";
                        }else {
                            str+="<td>无</td>";
                        }
                        if(data.sunhuai[i]!=null){
                            str+="<td>"+(data.sunhuai[i].userfeedbacktype==0?'其他损坏':(data.sunhuai[i].userfeedbacktype==1?'床位损坏':(data.sunhuai[i].userfeedbacktype==2?'柜门损坏':'无法归还')))+"</td>>";

                        }else {
                            str+="<td>无</td>>";

                        }
                        if(data.weixiu[i]!=null){
                            str+="<td>"+(data.weixiu[i].reportstatus==1?'待修复':(data.weixiu[i].reportstatus==2?'修复中':data.weixiu[i].reportstatus==3?'已修复':'无法修复'))+"</td>>";
                            str+="<td>"+data.weixiu[i].reporttime+"</td>>";
                        }else {
                            str+="<td>无</td>";
                            str+="<td>无</td>";
                        }

                        str+="</tr>";
                    }


                }else {
                    str+="无记录";
                }
                $("#table_order").html(str);
                $("#table_count").text(data.sesUser.length);
            }

        })
    }
    //维修记录



</script>

</body>
</html>
